From f75240210cfaccd16d755d4ef91445c5973a1ec8 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 26 Nov 2004 12:10:24 +0000 Subject: [PATCH] Tell regexp parser to use extra analysis on external link regexp; this saves about 10ms on [[Zuiderzee Works]] on my test rig. --- includes/Parser.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/Parser.php b/includes/Parser.php index a087f2a8a8..433487a5f6 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1040,7 +1040,10 @@ class Parser * @access private */ function replaceFreeExternalLinks( $text ) { - $bits = preg_split( '/((?:'.URL_PROTOCOLS.'):)/', $text, -1, PREG_SPLIT_DELIM_CAPTURE ); + $fname = 'Parser::replaceFreeExternalLinks'; + wfProfileIn( $fname ); + + $bits = preg_split( '/((?:'.URL_PROTOCOLS.'):)/S', $text, -1, PREG_SPLIT_DELIM_CAPTURE ); $s = array_shift( $bits ); $i = 0; @@ -1092,6 +1095,7 @@ class Parser $s .= $protocol . $remainder; } } + wfProfileOut(); return $s; } -- 2.20.1